<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>华猫商城</title>
		<style></style>
		<!--<link href="../css/jquery.validator.css" rel="stylesheet">-->
		<link href="../css/common.css" rel="stylesheet">

		<link href="../plugin/userLib/css/user.css" rel="stylesheet">
		<link href="../plugin/userLib/css/userinfo.css" rel="stylesheet">
		<link href="../plugin/userLib/css/my_user.css" rel="stylesheet">
		<link href="../css/base.css" rel="stylesheet">
		<link href="../plugin/userLib/css/shop.css" rel="stylesheet">
		<link href="../plugin/userLib/css/shop_a.css" rel="stylesheet">
		<!--<link href="../plugin/webuploader/webuploader.css" rel="stylesheet">
		<link href="../plugin/webuploader/batchupload.css" rel="stylesheet">
		<link href="../plugin/kindeditor/themes/default/default.css" rel="stylesheet">-->
		<style>
			select{
				padding-right: 20px !important;
			}
		</style>
	</head>

	<body>
		<div id="header"></div>
		<div id="headerBox"></div>
		<!--<div id="nav_menu"></div>-->
		<div class="ZZHT-wrap">
			<div class="ZZHT-header" style="border-bottom: 1px solid #ffffff;">
				<div class="ZZHT-shop-nav">
					<div class="ZZHT-nav-box">
						<a href="#">
							<li class="liselect ZZHT-lfloat ZZHT-nav-boxa">商城商家</li>
						</a>
						<div class="ZZHT-clear"></div>
					</div>
				</div>
				<div class="ZZHT-clear"></div>
			</div>
			<div class="ZZHT-main">
				<div id="onLine_left"></div>
				<div class="ZZHT-content">

					<div class="ZZHT-user-head clearfix"><span class="left fl">已上架商品</span><span class="rights fr">当前位置：商品管理--已上架商品</span></div>
					<div class="search-wrap">
						<form class="search-form" name="form">
							<label>
            					商品分类：
            					<select name="shopCatId1" id="shopCatId1" class="s-query" v-model="cat1">
                					<option value="">-请选择-</option>
                                  	<option :value="v.catId" v-for="v in menu" v-if="v.parentId=='0'">{{v.catName}}</option>
                          		</select>
            					<select name="shopCatId2" id="shopCatId2" class="s-query">
            						<option value="">-请选择-</option>
            						<option :value="v.catId" v-for="v in menu" v-if="cat1 && (v.parentId == cat1)">{{v.catName}}</option>
            					</select>
        					</label>
							<label>
          						商品名称：
          						<input type="text" name="goodsName" id="goodsName" class="s-query">
        					</label>
							<a href="javascript:;" class="btn-inquire" onclick="goodsByPage()"><i class="icon-search"></i></a>
						</form>
					</div>
					<div class="ZZHT-shop-content">
						<div class="s-menu">
							<a href="javascript:;" onclick="changList('isSale',0)"><i class="icon_unshelf"></i><span>下架</span></a>
							<a href="javascript:void(0);" onclick="changList('isRecom')"><i class="icon_recommend"></i><span>推荐</span></a>
							<a href="javascript:void(0);" onclick="changList('isNew')"><i class="new_product"></i><span>新品</span></a>
							<a href="javascript:void(0);" onclick="changList('isBest')"><i class="icon_exquisite"></i><span>精品</span></a>
							<a href="javascript:void(0);" onclick="changList('isHot')"><i class="icon_seller"></i><span>热销</span></a>
							<a href="javascript:void(0);" onclick="delList('sale')"><i class="icon_delete"></i><span>删除</span></a>
							<a href="javascript:void(0);" onclick="location.href='goods2.html'"><i class="icon_add"></i><span>新增</span></a>
						</div>
						<table class="ZZHT-list ZZHT-lists">
							<thead>
								<tr>
									<th width="10">
										<div class="checkbox-box-s checkbox-box-s-all">
											<input class="ZZHT-checkbox-s lists-chk" @click='checkedAll()' type="checkbox" id="all" style="top:-8px!important;">
											<label for="all"></label>
										</div>
									</th>
									<th>商品名称</th>
									<th>商品编号</th>
									<th>价格</th>
									<th>推荐</th>
									<th>精品</th>
									<th>新品</th>
									<th>热销</th>
									<!--<th>销量</th>-->
									<th>库存</th>
									<th width="150">操作</th>
								</tr>
							</thead>
							<tbody id="list1">
								<tr v-for="(v,i) in tab">
									<td>
										<div class="checkbox-box-s">
											<input type="checkbox" class="chk ZZHT-checkbox-s lists-chk" :id='"chk-"+i' v-model="checkArr" :value="v.goodsId">
											<label :for='"chk-"+i'></label>
										</div>
									</td>
									<td>
										<div class="goods-img">
											<a href="#none"> <img class="j-lazyGoodsImg" :src='v.goodsImg' style="display: inline;"> </a>
										</div>
										<p class="goodsName"> {{v.goodsName}} </p>
									</td>
									<td>{{v.goodsSn}}</td>
									<td>{{'￥'+v.shopPrice}}</td>
									<td>
										<div title="双击可修改" @dblclick="changSaleStatusa(&quot;isRecom&quot;,i,v.goodsId)" :class='v.isRecom==0?"w-r wrong":"w-r right"'></div>
									</td>
									<td>
										<div title="双击可修改" @dblclick="changSaleStatusa(&quot;isBest&quot;,i,v.goodsId)" :class='v.isBest==0?"w-r wrong":"w-r right"'></div>
									</td>
									<td>
										<div title="双击可修改" @dblclick="changSaleStatusa(&quot;isNew&quot;,i,v.goodsId)" :class='v.isNew==0?"w-r wrong":"w-r right"'></div>
									</td>
									<td>
										<div title="双击可修改" @dblclick="changSaleStatusa(&quot;isHot&quot;,i,v.goodsId)" :class='v.isHot==0?"w-r wrong":"w-r right"'></div>
									</td>
									<!--<td>{{v.saleNum}}</td>-->
									<td> {{v.goodsStock}} </td>
									<td>
										<a class="g-handle ZZHT-fred" :href='"../view/detail.html?goodsId="+v.goodsId'>查看</a>
										<a class="g-handle ZZHT-fred" :href='"goods2.html?goodsId="+v.goodsId'>编辑</a>
										<a class="g-handle ZZHT-fred" href='#none' @click="del(i,v.goodsId)">删除</a>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div style="text-align: center;" id="pager"></div>
				</div>

			</div>
			<div style="clear:both;"></div>
			<br>
		</div>
		<div id="ck3"></div>
		<script src="../js/jquery.min.js"></script>
		<script src="../js/vue.min.js"></script>
		<script type="text/javascript" src="../js/ljf_base.js"></script>
		<script type="text/javascript" src="../js/common.js"></script>
		<script type="text/javascript" src="../js/common_view.js"></script>
		<script src="../plugin/layer/layer.js"></script>
		<script src="../plugin/userLib/js/online_goodsList.js"></script>
		<script>
			var search_data = {};
			var pages = 1;
			var pageNum = 1;
			var shopId = '';//店铺Id
			
			initPage();
			
			$(function(){
				init();
			})
			
			var vm = new Vue({
				el: '.ZZHT-content',
				data: {
					tab: [],
					checkArr: [], //被选中的goodsid 列表
					menu:[],//店铺两级分类
					cat1:'',//当前选择的第一级分类
				},
				methods: {
					changSaleStatusa: function(isWhat, i, id) { 
						var that = this;
						changSaleStatusa(isWhat, i, id ,that)
					},
					del: function(i, id) {
						var that = this;
						del(i,id,that);
					},
					checkedAll: function() { //全选
						var _this = this;
						checkAll(_this);
					},
				}
			});
			
			function getList() {
				var url = "goods/sellStockGoods";//接口地址
				
				var data = $.extend(true,{},search_data);
				
				data.isSale = 1;
				
				getListByUrl(url,data)
			};
		</script>
	</body>

</html>